import type { RouteRecordRaw } from 'vue-router';

import { BasicLayout } from '#/layouts';
import { $t } from '#/locales';

const routes: RouteRecordRaw[] = [
  {
    component: BasicLayout,
    meta: {
      icon: 'lucide:book-open-text',
      order: 5,
      title: $t('page.survey.title'),
    },
    name: 'Survey',
    path: '/survey',
    children: [
      {
        name: 'index',
        path: '/survey/index',
        component: () => import('#/views/survey/index.vue'),
        meta: {
          title: $t('page.survey.list'),
        },
      },
      {
        name: 'SurveyDetail',
        path: '/survey/detail/:id',
        component: () => import('#/views/survey/detail.vue'),
        meta: {
          activePath: '/survey',
          hideInMenu: true,
          maxNumOfOpenTab: 3,
          title: $t('page.survey.detail'),
        },
      },
      {
        name: 'SurveyEdit',
        path: '/survey/edit/:id',
        component: () => import('#/views/survey/edit.vue'),
        meta: {
          activePath: '/survey',
          hideInMenu: true,
          maxNumOfOpenTab: 3,
          title: $t('page.survey.edit'),
        },
      },
      {
        name: 'SurveyResult',
        path: '/survey/result/:id',
        component: () => import('#/views/survey/result.vue'),
        meta: {
          activePath: '/survey',
          hideInMenu: true,
          maxNumOfOpenTab: 3,
          title: $t('page.survey.result'),
        },
      },
      {
        name: 'SurveyCreate',
        path: '/survey/create',
        component: () => import('#/views/survey/create.vue'),
        meta: {
          activePath: '/survey',
          hideInMenu: true,
          maxNumOfOpenTab: 3,
          title: $t('page.survey.create'),
        },
      },
    ],
  },
];

export default routes;
